home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’87 / Source ƒ.sit / Source ƒ / C ƒ / CITADEL BBS 'C' SRC / CTDL.H < prev    next >
C/C++ Source or Header  |  1987-01-14  |  20KB  |  582 lines

  1. /************************************************************************/
  2. /*                Ctdl.h                    */
  3. /*    #include file for all Citadel C files.                */
  4. /*    Now includes only #defines and structs.             */
  5. /************************************************************************/
  6.  
  7. #define  _C86_BIG  1
  8. #include "stdio.h"
  9.  
  10. /************************************************************************/
  11. /* 85Oct16 HAW    Add code for OFFICE-STUFF parameter.            */
  12. /* 85Aug29 HAW    Install code to allow double msg files for autobackup.    */
  13. /* 85Jun19 HAW    Implant exit values so batch files can be made useful.    */
  14. /* 85May27 HAW    Start adding networking gunk.                */
  15. /* 85May22 HAW    MAXLOGTAB now sysop selectable.             */
  16. /* 85May06 HAW    Add daily bailout parameter.                */
  17. /* 85May05 HAW    Add SYSDISK parameter.                    */
  18. /* 85Mar20 HAW    Add timestamp code.                    */
  19. /* 85Feb21 HAW    Add directory names.                    */
  20. /* 85Feb20 HAW    Implement IMPERVIOUS flag.                */
  21. /* 85Feb18 HAW    Insert global variables for baud search.        */
  22. /* 85Jan20 HAW    Insert code to read from system clock.            */
  23. /* 84Aug30 HAW    Begin conversion to MS-DOS                */
  24. /*                                    */
  25. /*                #defines        82Dec10 dvm    */
  26. /*                                    */
  27. /* #defs supported in current system:                    */
  28. /*                                    */
  29. /* #def FDC-1 for the TeleTek (dvm code)                */
  30. /* #def VFC-2 for the Big Board (dvm code)                */
  31. /*                                    */
  32. /* #def TEST for special small-scale test version            */
  33. /************************************************************************/
  34.  
  35. #define ulong    unsigned long    /* Makes it easier to format        */
  36. #define MSDOS    1
  37.  
  38. #define NAMESIZE       20    /* length of room names         */
  39.  
  40. typedef char label[NAMESIZE];
  41.  
  42. /* Citadel programs use readSysTab() and writeSysTab() to write an    */
  43. /* image of the external variables in RAM to disk, and later restore    */
  44. /* it.    The image is stored in ctdlTabl.sys .  If ctdlTabl.sys is lost, */
  45. /* confg.com will automatically reconstruct the hard way when invoked,    */
  46. /* and write a new ctdlTabl.sys out when finished.  CtdlTabl.sys is    */
  47. /* always destroyed after reading, to minimize the possibility of    */
  48. /* reading an out-of-date version.  In general, the technique works    */
  49. /* well and saves time and head-banging on bootup.  You should,     */
  50. /* however, note carefully the following caution:            */
  51. /*  o  Whenever you change the declarations in Ctdl.h you should:    */
  52. /*   -->  destroy the current ctdlTabl.sys file             */
  53. /*   -->  recompile and reload all citadel programs which access    */
  54. /*      ctdlTabl.sys -- currently citadel.com & configur.com        */
  55. /*   -->  use configur.com to build a new ctdlTabl.sys file        */
  56. /*                                    */
  57. /* If you ignore these warnings, little pixies will prick you in your    */
  58. /* sleep for the rest of your life.                    */
  59. /************************************************************************/
  60.  
  61.         /* Let's begin by defining the configuration struct.    */
  62.         /* This is part of the contents of ctdltabl.sys     */
  63. struct config {
  64.  
  65.     unsigned maxMSector;    /* Max # of sectors (simulated)     */
  66.  
  67.     char megaHz;        /* 8088 clock rate (for wait loops)    */
  68.  
  69.     ulong oldest;        /* 32-bit ID# of first message in system*/
  70.     ulong newest;        /* 32-bit ID# of last  message in system*/
  71.  
  72.     int  nodeName;        /* Offsets in codeBuf            */
  73.     int  nodeTitle;
  74.     int  nodeId;
  75.     int  bRoom;
  76.     int  netPrefix, netSuffix;
  77.  
  78.     char noChat;        /* TRUE to suppress chat attempts    */
  79.  
  80.     int  cryptSeed;
  81. #ifndef MSDOS
  82.     char clock;         /* TRUE  if we have a hardware clock    */
  83. #endif
  84.  
  85.     char search_baud;        /* TRUE to do flip flop search for baud */
  86.     char IBM_or_clone;        /* Specialize for Sperry PC <sigh>    */
  87.  
  88. #define COMINT_VEC    12
  89.     int  modem_status;        /* Modem addresses            */
  90.     int  modem_data;
  91.     int  line_status;
  92.  
  93.     char dailyTimeout;        /* Do we want to bail out on a daily    */
  94.     int  hourOut;        /* basis? When?             */
  95.  
  96.     char call_log;        /* if < 100, indicates drive for log    */
  97.  
  98.     char mirror;        /* Auto backup of message files?    */
  99.     char mbkpDisk;        /* Where is this file located?        */
  100.  
  101.     char filter[128];        /* input character translation table    */
  102.  
  103.     char homeDisk, msgDisk, sysDisk;/* where we keep our data files    */
  104.     char netDisk;        /* where we want to find net files    */
  105.     char ourDisk;        /* where we are just now        */
  106.     char ourUser[10];
  107.  
  108.     char unlogEnterOk;        /* TRUE if OK to enter messages anon    */
  109.     char unlogReadOk;        /* TRUE if unlogged folks can read mess */
  110.     char unlogLoginOk;        /* TRUE if spontan. new accounts ok.    */
  111.     char nonAideRoomOk;     /* TRUE general folks can make rooms    */
  112.     char noMail;        /* TRUE if mail is not allowed        */
  113.  
  114.     char sysBaud;
  115.  
  116.     char netParticipant;    /* TRUE if participating in the net    */
  117.     char longHaul;        /* TRUE if willing to do long distance    */
  118.     char dayDiv;        /* Days to network on            */
  119.     char netHour;        /* Hour to start networking on        */
  120.     char netLength;        /* Length of networking         */
  121.     int  netSize;
  122.     int  incomingHost;
  123.     int  outcomingHost;
  124.  
  125.  
  126. /*    stuff to distinguish the various Citadel programs        */
  127. #define CITADEL     0    /* principal program            */
  128. #define xxxxx        1    /* unused                */
  129. #define NET        2    /* network downloader            */
  130. /*#define ARCHIVE        3 */    /* backup program        (future)        */
  131. #define CONFIGUR    4
  132. #define UTILITY     5
  133.     char    weAre;        /* set first thing by main()        */
  134.     int     paramVers;
  135.  
  136. /*            Stuff to size system with:            */
  137. /* WARNING!!! if you expand MAXROOMS beyond 128, horrible, horrible    */
  138. /* things will happen to the userlog entries, which will no longer    */
  139. /* fit in the assigned 256-byte records and will overwrite things    */
  140. /* with normally undesirable results. 82Nov10CrT            */
  141.  
  142. #define MAXROOMS       64    /* number of rooms allowed in system    */
  143. #define SHARED_ROOMS   10
  144.  
  145.     int MAXLOGTAB;        /* number of log entries supported    */
  146.  
  147.  
  148. /*        Stuff nowadays usually in bdscio.h:            */
  149. /* values for functions to return: */
  150. #define TRUE        1
  151. #define FALSE        0
  152. #define ERROR           -1
  153.  
  154. #define SAMESTRING    0    /* value for strcmp() & friend        */
  155.  
  156. /* ASCII characters: */
  157. #define SOH        1
  158. #define CNTRLC        3
  159. #define EOT        4
  160. #define ACK        6
  161. #define BELL        7
  162. #define BACKSPACE    8
  163. #define CNTRLI        9    /* aka tab                */
  164. #define TAB        9    /* aka ^I                */
  165. #define NEWLINE        10    /* "linefeed" to philistines.        */
  166. #define CNTRLO           15
  167. #define CNTRLl           12    /* Sysop privileges            */
  168. #define XOFF           19    /* control-s                */
  169. #define NAK           21
  170. #define CAN           24
  171. #define CNTRLZ           26
  172. #define CPMEOF       CNTRLZ
  173. #define ESC           27    /* altmode                */
  174. #define CRC_START     'C'
  175. #define DEL         0x7F    /* delete char                */
  176.  
  177. /*            Stuff for rooms:                */
  178. #define LOBBY        0    /* Lobby> is >always< room 0.        */
  179. #define MAILROOM    1    /* Mail>  is >always< room 1.        */
  180. #define AIDEROOM    2    /* Aide> is >always< room 2.        */
  181.  
  182. #ifdef TEST
  183. #define MSGSPERRM      58    /* should be >= MAILSLOTS        */
  184. #else
  185. #define MSGSPERRM      58    /* roombuf must be 256 bytes or less.    */
  186. #endif
  187.  
  188. #define SECTSIZE      128
  189.  
  190. #define MAXCODE       512
  191.     unsigned char codeBuf[MAXCODE];/* buffer for configuration routines */
  192.     unsigned char scratch[40];    /* scratch space for config routines    */
  193.     unsigned char shave[8];    /* shave-and-a-haircut/2 bits pauses    */
  194.  
  195. /* routine offsets in codeBuf: */
  196.     int pBauds[4];        /* Indexes into here defined later    */
  197.     int pHangUp, pCarrDetect, pMIReady, pMOReady, pInitPort;
  198.     int pCheckBaud;
  199. #ifndef MSDOS        /* MSDOS has and uses system clock, so if using */
  200.             /* it, don't need this stuff.            */
  201.     int pInitDate, pGetDay, pGetMonth, pGetYear;
  202. #endif
  203.     int  catChar;
  204.     unsigned catSector;
  205.  
  206.     char debug;         /* turns debug printout on and off    */
  207.  
  208.     int  sizeLTentry;        /* contains size of a logTab entry    */
  209.     char sysPassword[200];    /* Remote sysop             */
  210. } ;             /* And that's all of the variables we want to save */
  211.  
  212. /************************************************************************/
  213. /*                  Room data                */
  214. /************************************************************************/
  215. #define MAXGEN           32    /* six bits of generation => 64 of them */
  216. #define FORGET_OFFSET  (MAXGEN / 2)    /* For forgetting rooms     */
  217.  
  218. #define LINNEW        0x0041    /* Only list unread rooms        */
  219. #define NORNEW        0x0051
  220. #define NOROLD        0x0052    /* List both unread and read rooms    */
  221.       /* List forgotten public rooms          */
  222. #define FGTRMS        ((FORGET_OFFSET < 8) + 0x0000)
  223.  
  224. struct rflags {         /* Room flags                */
  225.     unsigned INUSE    : 1;    /* Room in use?             */
  226.     unsigned PUBLIC   : 1;    /* Room public?             */
  227.     unsigned MSDOSDIR : 1;    /* Room directory?            */
  228.     unsigned PERMROOM : 1;    /* Room permanent?            */
  229.     unsigned SKIP     : 1;    /* Room skipped? (temporary for user)    */
  230.     unsigned UPLOAD   : 1;    /* Can room be uploaded to?        */
  231.     unsigned DOWNLOAD : 1;    /* Can room be downloaded from?     */
  232.     unsigned SHARED   : 1;
  233.     unsigned ARCHIVE  : 1;
  234.     unsigned rflag3   : 1;
  235.     unsigned rflag4   : 1;
  236.     unsigned rflag5   : 1;
  237.     unsigned rflag6   : 1;
  238.     unsigned rflag7   : 1;
  239.     unsigned rflag8   : 1;
  240.     unsigned rflag9   : 1;
  241.     unsigned rflag10  : 1;
  242.     unsigned rflag11  : 1;
  243.     unsigned rflag12  : 1;
  244.     unsigned YUCK     : 0;    /* Force realignment I guess.        */
  245. } ;
  246.  
  247. struct rTable {         /* The summation of a room        */
  248.     unsigned char rtgen;    /* generation # of room         */
  249.     struct rflags rtflags;    /* public/private flag etc        */
  250.     label      rtname;    /* name of room             */
  251.     ulong      rtlastMessage;/* # of most recent message in room    */
  252. } ;                /* And see ROOMA.C for declaration    */
  253.  
  254. struct aRoom {            /* The appearance of a room:        */
  255.     unsigned char rbgen;    /* generation # of room         */
  256.     struct rflags rbflags;    /* same bits as flags above        */
  257.     label      rbname;    /* name of room             */
  258.     char      rbdisk;    /* disk this rooms files are in 0=>none */
  259.     char      rbdirname[9]; /* user directory for this room's files */
  260.     struct {
  261.     ulong rbmsgNo;        /* every message gets unique#        */
  262.     unsigned rbmsgLoc;    /* sector message starts in        */
  263.     } msg[MSGSPERRM];
  264. } ;                /* And see ROOMA.C for declaration    */
  265.  
  266. /************************************************************************/
  267. /*                  userlog stuff                */
  268. /************************************************************************/
  269. #define CRYPTADD      117    /*                    */
  270.  
  271. struct lflags {         /* Flags for person in log        */
  272.     unsigned UCMASK    : 1;    /* Uppercase?                */
  273.     unsigned LFMASK    : 1;    /* Linefeeds?                */
  274.     unsigned EXPERT    : 1;    /* Expert?                */
  275.     unsigned AIDE      : 1;    /* Vice-Grand-Poobah?            */
  276.     unsigned L_INUSE   : 1;    /* Is this slot in use?         */
  277.     unsigned TIME      : 1;    /* Send time to user of msg creation?    */
  278.     unsigned OLDTOO    : 1;    /* Print out last oldmessage on <N>ew?    */
  279.     unsigned NET_PRIVS : 1;    /* User have net privileges?        */
  280.     unsigned RUGGIE    : 1;    /* Juvenile? Future fun-ness        */
  281.     unsigned lflag1    : 1;
  282.     unsigned lflag2    : 1;
  283.     unsigned lflag3    : 1;
  284.     unsigned lflag4    : 1;
  285.     unsigned lflag5    : 1;
  286.     unsigned lflag6    : 1;
  287.     unsigned lflag7    : 1;
  288.     unsigned lflag8    : 1;
  289.     unsigned lflag9    : 1;
  290.     unsigned YUCK      : 0;    /* Force realignment    ???        */
  291. } ;
  292.  
  293. #define MAILSLOTS      58    /* Same as normal room            */
  294.  
  295. #define MAXVISIT    8    /* #visits we remember old newestLo for */
  296.  
  297. #define GENSHIFT    3    /* Where the generation # is        */
  298. #define CALLMASK    7    /* For finding last visit        */
  299.  
  300. struct logBuffer {        /* The appearance of a user:        */
  301.     unsigned char lbnulls;    /* #nulls, lCase, lFeeds        */
  302.     struct lflags lbflags;    /* UCMASK, LFMASK, EXPERT, AIDE, INUSE    */
  303.     unsigned char lbwidth;    /* terminal width            */
  304.     char      credit;    /* Credit for long distance calls    */
  305.     label      lbname;    /* caller's name            */
  306.     label      lbpw;     /* caller's password            */
  307.     unsigned char lbgen[MAXROOMS];/* 5 bits gen, 3 bits lastvisit    */
  308.     ulong     lbvisit[MAXVISIT];/* newestLo for this and 3 prev. visits */
  309.     unsigned  lbslot[MAILSLOTS];/* for private mail            */
  310.     ulong     lbId[MAILSLOTS];    /* for private mail            */
  311. } ;                /* And see LOG.C for declaration    */
  312.  
  313. struct lTable {         /* Summation of a person:        */
  314.     int   ltpwhash;        /* hash of password            */
  315.     int   ltnmhash;        /* hash of name             */
  316.     int   ltlogSlot;        /* location in userlog.buf        */
  317.     ulong ltnewest;        /* last message on last call        */
  318. } ;                /* And see LOG.C for declaration    */
  319.  
  320. /************************************************************************/
  321. /*            terminal stuff                    */
  322. /************************************************************************/
  323. #define SPECIAL        27    /* <ESC>    console escape char    */
  324.  
  325. /************************************************************************/
  326. /*            message stuff                    */
  327. /************************************************************************/
  328. #define MAXTEXT      7500    /* maximum chars in edit buffer     */
  329.  
  330. #define HELD 3
  331.  
  332. struct msgB {            /* This is what a msg looks like    */
  333.     int  Ooops;
  334.     char mbtext[MAXTEXT]  ;    /* buffer text is edited in        */
  335.  
  336.     int  mbheadChar      ;    /* start of message            */
  337.     unsigned     mbheadSector;    /* start of message            */
  338.  
  339.     label mbauth ;        /* name of author            */
  340.     label mbdate ;        /* creation date            */
  341.     label mbtime ;        /* creation time            */
  342.     label mbId     ;        /* local number of message        */
  343.     label mboname;        /* short human name for origin system    */
  344.     label mborig ;        /* US xxx xxx xxxx style ID        */
  345.     label mbroom ;        /* creation room            */
  346.     label mbsrcId;        /* message ID on system of origin    */
  347.     label mbto     ;        /* private message to            */
  348.     label mbaddr ;        /* address of system for net routing    */
  349. } ;                /* declaration in MSG.C         */
  350.  
  351. /* values for showMess routine */
  352. #define NEWoNLY     0
  353. #define OLDaNDnEW    1
  354. #define OLDoNLY     2
  355. #define GLOBALnEW    3
  356.  
  357. /************************************************************************/
  358. /*            modem stuff                    */
  359. /************************************************************************/
  360. #ifdef MSDOS
  361.  
  362. /* Interrupt constants    */
  363. #define INTA01        0x21            /* Interrupt controller */
  364. #define EOI        0x20            /* End of Interrupt    */
  365.  
  366. #endif
  367.  
  368. /* somestuff readfile() and sendfile() like:    */
  369. #define LOOPSPERSEC  5000
  370. #define ERRORMAX       10
  371. #define RETRYMAX       10
  372.  
  373. /* fiddle factor to timeout on no input: */
  374. #define HITIMEOUT    7276    /* processor dependent, see MODEM.C    */
  375.  
  376. #define NEWCARRIER   0x01    /* returned to main prog on login    */
  377.  
  378. #define MODEM        0    /* current user of system is        */
  379. #define CONSOLE     1    /* one of these             */
  380.  
  381. /*  output XON/XOFF etc flag... */
  382. #define OUTOK        0    /* normal output            */
  383. #define OUTPAUSE    1    /* a pause has been requested        */
  384. #define OUTNEXT     2    /* quit this message, get the next    */
  385. #define OUTSKIP     3    /* stop current process         */
  386. #define OUTPARAGRAPH    4    /* skip to next paragraph        */
  387. #define IMPERVIOUS    5    /* make current output unstoppable    */
  388.  
  389. #define NEITHER     0    /* don't echo input at all        */
  390. #define CALLER        1    /* echo to caller only --passwords etc    */
  391. #define BOTH        2    /* echo to caller and console both    */
  392.  
  393. #define NO_ECHO     0    /* Echo input as X's            */
  394. #define ECHO        1    /* Echo input    (getString())        */
  395.  
  396.  
  397. /*    stuff for the mini-INTRPreter that drives the modem:        */
  398. /* opcodes for the interpreter: */
  399. #define ANDI        1
  400. #define INP        2
  401. #define LOAD        3
  402. #define LOADI        4
  403. #define ORI        5
  404. #define OUTP        6
  405. #define OUTSTRING    7
  406. #define PAUSEI        8
  407. #define RET        9
  408. #define STORE           10
  409. #define XORI           11
  410. #define STOREX           12
  411. #define LOADX           13
  412. #define OPRNUMBER      14
  413. #define TOBDC           15
  414. #define TODEC           16
  415.                     /* For system calls.        */
  416. struct regval {int ax, bx, cx, dx, si, di, ds, es; };
  417.  
  418. #define STARTUP 1
  419. #define FINISH    2
  420.  
  421. /************************************************************************/
  422. /*            net stuff                    */
  423. /************************************************************************/
  424.  
  425. #define ONLY_300    0
  426. #define BOTH_300_1200    1
  427. #define TH_3_12_24    2
  428. #define SetYourOwn    3
  429.  
  430. #define HANGUP        0
  431. #define NORMAL_MAIL    1
  432. #define R_FILE_REQ    2
  433. #define A_FILE_REQ    3
  434. #define NET_ROOM    5
  435. #define CHECK_MAIL    6
  436. #define ROLE_REVERSAL    201
  437.  
  438. #define BAD        0
  439. #define GOOD        1
  440.  
  441. #define NO_ERROR    0    /* These refer to negative ack mail    */
  442. #define NO_RECIPIENT    1
  443. #define BAD_FORM    2
  444. #define UNKNOWN     99
  445.  
  446. struct nflags {         /* Any and all reasons to call this node*/
  447.     unsigned normal_mail : 1;
  448.     unsigned in_use     : 1;
  449.     unsigned room_files  : 1;
  450.     unsigned local     : 1;
  451.     unsigned flag1     : 1;
  452.     unsigned flag2     : 1;
  453.     unsigned flag3     : 1;
  454.     unsigned flag4     : 1;
  455.     unsigned flag5     : 1;
  456.     unsigned flag6     : 1;
  457.     unsigned flag7     : 1;
  458.     unsigned flag8     : 1;
  459.     unsigned flag9     : 1;
  460.     unsigned flag10     : 1;
  461.     unsigned flag11     : 1;
  462.     unsigned flag12     : 1;
  463.     unsigned flag13     : 1;
  464.     unsigned flag14     : 1;
  465.     unsigned flag15     : 1;
  466.     unsigned flag16     : 1;
  467.     unsigned realign     : 0;
  468. } ;
  469.  
  470. struct shared_room {
  471.     ulong lastMess;
  472.     unsigned srgen;            /* High bit of gen is used flag */
  473.     unsigned srslot;
  474. } ;
  475.  
  476. struct nodeRoomsTab {
  477.     struct shared_room rooms[SHARED_ROOMS];
  478. } ;
  479.  
  480. struct netBuffer {
  481.     label      netId;
  482.     label      netName;
  483.     struct nflags nbflags;
  484.     char      baudCode;
  485.     struct shared_room netRooms[SHARED_ROOMS];
  486. } ;
  487.  
  488. struct netTable {
  489.     int       ntnmhash;
  490.     int       ntidhash;
  491.     struct nflags ntflags ;
  492. } ;
  493.  
  494. struct cmd_data {        /* Commands for networking        */
  495.     unsigned char command;
  496.     char      fields[4][NAMESIZE];
  497. } ;
  498.  
  499. struct netMLstruct {
  500.     ulong    ML_id;
  501.     unsigned ML_loc;
  502. } ;
  503.  
  504. struct fl_req {
  505.     label room;
  506.     label roomfile;
  507.     char  drive;
  508.     char  path[100];
  509.     label filename;
  510. } ;
  511.  
  512. /************************************************************************/
  513. /*            Exit values for errorlevels            */
  514. /************************************************************************/
  515. #define SYSOP_EXIT           0
  516. #define TIME_EXIT           1
  517. #define CRASH_EXIT           2
  518. #define REMOTE_SYSOP_EXIT      3
  519.  
  520. /************************************************************************/
  521. /*            Useful psuedo functions             */
  522. /************************************************************************/
  523. #define gotCarrier()    interpret(cfg.pCarrDetect)
  524. #define onLine()    (haveCarrier    ||   onConsole)
  525. #define wrNetId(x)    ((strCmpU(x, ALL_LOCALS) != 0) ? x : WRITE_LOCALS)
  526. #define zero_struct(x)    setmem(&x, sizeof x, 0)
  527.  
  528. #define putMLNet(f,b)    if (fwrite(&b, sizeof(b), 1, f) != 1)\
  529.                      crashout("putMLNet crash")
  530. #define getMLNet(f,b)    (fread(&b, sizeof(b), 1, f) == 1)
  531. #define TheSysop()    (aide && onConsole)
  532. #define copy_struct(src, dest)    movmem(&src, &dest, sizeof src)
  533. #define copy_array(src, dest)    movmem(src, dest, sizeof src)
  534.  
  535. #ifndef NET_BUG
  536.  
  537. #define check()     /* Null function -- real source is in the net source */
  538.  
  539. #else
  540. #endif
  541.  
  542. #define needToCall(i)    (netTab[i].ntflags.in_use == TRUE &&\
  543. (netTab[i].ntflags.normal_mail == TRUE || netTab[i].ntflags.room_files == TRUE\
  544. || roomsShared(i)))
  545.  
  546. #define setNeedsProcessing(i)    netBuf.netRooms[i].srslot |= 0x8000;
  547. #define chkNeedsProcessing(i)    (netBuf.netRooms[i].srslot & 0x8000)
  548. #define resetNeedsProcessing(i) netBuf.netRooms[i].srslot &= 0x7FFF;
  549.  
  550. #define isSharedRoom(h, i)    (sharedRoom[h].rooms[i].srgen & 0x8000)
  551. #define resetNetRoomFlag(i)    netBuf.netRooms[i].srgen &= 0x7FFF;\
  552.                 sharedRoom[thisNet].rooms[(i)].srgen &= 0x7FFF;
  553. #define netRoomSlot(i)        (netBuf.netRooms[i].srslot & 0x7FFF)
  554. #define netTabRoomSlot(h,i)    (sharedRooms[h].rooms[i].srslot & 0x7FFF)
  555. #define netGen(i)        (netBuf.netRooms[i].srgen & 0x7FFF)
  556. #define roomValidate(i)     (roomTab[netRoomSlot(i)].rtgen == netGen(i))
  557.  
  558. #define INTERVALS 8        /* Half second intervals        */
  559.  
  560. #define minimum(x,y)  ((x) < (y) ? (x) : (y))
  561.  
  562. /************************************************************************/
  563. /*            Call log stuff                    */
  564. /************************************************************************/
  565. #define BAUD        0
  566. #define L_IN        1
  567. #define L_OUT        2
  568. #define CARRLOSS    3
  569. #define FIRST_IN    4
  570. #define LAST_OUT    5
  571. #define EVIL_SIGNAL    6
  572.  
  573. /************************************************************************/
  574. /*            Transfer protocol constants            */
  575. /************************************************************************/
  576. #define WC_NONE     0
  577. #define WC_NETWORK    1
  578. #define WC_NORMAL    2
  579.  
  580. #define NORMAL        0
  581. #define DISK        1
  582.